﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false"
    CodeFile="MenuMaintain.aspx.vb" Inherits="WebForm_Manage_MenuMaintain" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
    <asp:Label ID="lblTitle" runat="server" meta:resourcekey="lblTitle"></asp:Label>
    <br />
    <table>
        <tr style ="vertical-align:text-top">
            <td>
                <asp:HiddenField ID="hiUID" runat="server" />
            <asp:HiddenField ID="hiDBName" runat="server" />
                <asp:Button ID="btnInsert" runat="server" meta:resourcekey="btnInsert" />
                <TServerControl:TGridView runat="server" ID="gvMenu" AllowHoverEffect="True" AllowHoverSelect="True"
                    AllowPaging="True" AutoGenerateColumns="False" DataSourceID="DSMenu"  ShowFooterWhenEmpty="True" 
                ShowHeaderWhenEmpty="True" TotalRowCount="0"
                     SkinID="pager"  DataKeyNames="ProgramID" CellPadding="4" 
                    ForeColor="#333333" GridLines="None">
                    <PagerSettings Position="TopAndBottom" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <Columns>
                        <asp:TemplateField>
                            <EditItemTemplate>
                                <asp:Button ID="btnUpdate" CommandName="Update" runat="server" meta:resourcekey="btnUpdate" />
                                <asp:Button ID="btnCancel" CommandName="Cancel" runat="server" meta:resourcekey="btnCancel" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Button ID="btnEdit" CommandName="Edit" meta:resourcekey="btnEdit" runat="server"
                                    Text="Button" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="ProgramID" meta:resourcekey="ProgramID" ReadOnly="True" />
                        <asp:TemplateField meta:resourcekey="RootName">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtRootName" runat="server" Text='<%# Bind("RootName") %>' Width ="60px"></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblRootName" runat="server" Text='<%# Bind("RootName") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField meta:resourcekey="Name">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("Name") %>' Width ="60px"></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblName" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField meta:resourcekey="ChnName">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtChnName" runat="server" Text='<%# Bind("ChnName") %>' Width ="60px"></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblChnName" runat="server" Text='<%# Bind("ChnName") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField meta:resourcekey="EngName">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtEngName" runat="server" Text='<%# Bind("EngName") %>' Width ="60px"></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblEngName" runat="server" Text='<%# Bind("EngName") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField meta:resourcekey="NeedControl">
                            <EditItemTemplate>
                                <asp:CheckBox ID="cbNeedControl" runat="server" Checked='<%# Bind("NeedControl") %>' />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="cbNeedControl" runat="server" Checked='<%# Bind("NeedControl") %>'
                                    Enabled="False" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField meta:resourcekey="URL">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtUrl" runat="server" Text='<%# Bind("URL") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblURL" runat="server" Text='<%# Bind("URL") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField meta:resourcekey="GroupID">
                            <EditItemTemplate>
                                <asp:DropDownList ID="ddlGroupID" runat="server" DataSourceID="objDSGroupIDInsertDT"
                                    DataTextField="GroupName" DataValueField="GroupID" SelectedValue='<%# Bind("GroupID") %>'>
                                </asp:DropDownList>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:DropDownList ID="ddlGroupID" runat="server" AutoPostBack="True" DataSourceID="objDSGroupIDInsertDT"
                                    DataTextField="GroupName" DataValueField="GroupID" Enabled="False" SelectedValue='<%# Bind("GroupID") %>'>
                                </asp:DropDownList>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField meta:resourcekey="QueryString">
                            <EditItemTemplate>
                                <asp:CheckBox ID="cbQueryString" runat="server" Checked='<%# Bind("QueryString") %>' />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="cbQueryString" runat="server" Checked='<%# Bind("QueryString") %>'
                                    Enabled="False" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField meta:resourcekey="IsMenu">
                            <EditItemTemplate>
                                <asp:CheckBox ID="cbIsMenu" runat="server" Checked='<%# Bind("IsMenu") %>' />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="cbIsMenu" runat="server" Checked='<%# Bind("IsMenu") %>'
                                    Enabled="False" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField meta:resourcekey="Function">
                            <EditItemTemplate>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Button ID="btnSetup"  CommandName ="Select" runat="server" meta:resourcekey="btnSetup" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                    </Columns>
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <EditRowStyle BackColor="#999999" />
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                </TServerControl:TGridView>
                <asp:ObjectDataSource ID="DSMenu" runat="server" SelectMethod="GetMenu" TypeName="OAMS.BBL.MenuBBL"
                    UpdateMethod="UpdateMenu">
                    <UpdateParameters>
                        <asp:Parameter Name="ProgramID" Type="Int32" ConvertEmptyStringToNull="False" />
                        <asp:Parameter Name="RootName" Type="String" ConvertEmptyStringToNull="False" />
                        <asp:Parameter Name="Name" Type="String" ConvertEmptyStringToNull="False" />
                        <asp:Parameter Name="NeedControl" Type="Boolean" ConvertEmptyStringToNull="False" />
                        <asp:Parameter Name="URL" Type="String" ConvertEmptyStringToNull="False" />
                        <asp:Parameter Name="GroupID" Type="String" ConvertEmptyStringToNull="False" />
                        <asp:Parameter Name="QueryString" Type="Boolean" ConvertEmptyStringToNull="False" />
                        <asp:ControlParameter ControlID="hiUID" Name="UID" PropertyName="Value" Type="String" />
                        <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" />
                    </UpdateParameters>
                    <SelectParameters>
                        <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" />
                    </SelectParameters>
                </asp:ObjectDataSource>
                <asp:ObjectDataSource ID="objDSGroupIDInsertDT" runat="server" SelectMethod="GetGroupIDInsert"
                    TypeName="OAMS.BBL.GroupBBL">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </td>
            <td><br /><br /><br /><br />
                <TServerControl:TGridView runat="server" ID="gvMenuRights" 
                    AllowHoverEffect="True" AllowHoverSelect="True"
                    AllowPaging="True" DataSourceID="dsMenuRights" 
                     SkinID="pager"   ShowFooterWhenEmpty="True" 
                ShowHeaderWhenEmpty="True" TotalRowCount="0"
                    AutoGenerateColumns="False" Visible="False" CellPadding="4" ForeColor="#333333" 
                    GridLines="None">
                    
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <EditRowStyle BackColor="#999999" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    
                    <Columns>
                        <asp:TemplateField>
                            <EditItemTemplate>
                                <asp:Button ID="btnUpdate" CommandName="Update" runat="server" meta:resourcekey="btnUpdate" />
                                <asp:Button ID="btnCancel" CommandName="Cancel" runat="server" meta:resourcekey="btnCancel" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Button ID="btnEdit" CommandName="Edit" meta:resourcekey="btnEdit" runat="server"
                                    Text="Button" />
                            </ItemTemplate>
                        </asp:TemplateField>
                       
                        <asp:TemplateField meta:resourcekey="SeqNo">
                            <EditItemTemplate>
                              <asp:Label ID="lblSeqNo" runat="server" Text='<%# Bind("SeqNo") %>'></asp:Label>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblSeqNo" runat="server" Text='<%# Bind("SeqNo") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                        <asp:TemplateField meta:resourcekey="DisplayName">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtDisplayName" runat="server" Text='<%# Bind("DisplayName") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblDisplayName" runat="server" Text='<%# Bind("DisplayName") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                       
                    </Columns> 
                    
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <PagerSettings Position="TopAndBottom" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    
                </TServerControl:TGridView>
                <asp:ObjectDataSource ID="dsMenuRights" runat="server" 
                    SelectMethod="GetMenuRights" TypeName="OAMS.BBL.MenuBBL" 
                    UpdateMethod="UpdateMenuRights">
                    <UpdateParameters>
                        <asp:ControlParameter ControlID="gvMenu" Name="ProgramID" 
                            PropertyName="SelectedValue" Type="Int32" />
                        <asp:Parameter Name="SeqNo" Type="Int32" />
                        <asp:Parameter Name="DisplayName" Type="String" />
                        <asp:ControlParameter ControlID="hiUID" Name="UID" PropertyName="Value" 
                            Type="String" />
                        <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" />
                    </UpdateParameters>
                    <SelectParameters>
                        <asp:ControlParameter ControlID="gvMenu" Name="ProgramID" 
                            PropertyName="SelectedValue" Type="Int32" />
                        <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </td>
        </tr>
    </table>
      </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
